package com.meng.menggaga.protocol;

import com.android.volley.Request;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.meng.menggaga.entity.CommunityCategoryInfos;
import com.meng.menggaga.entity.CommunityDetailInfos;
import com.meng.menggaga.entity.CommunityInfos;
import com.meng.menggaga.entity.UserInfo;

public interface MoccaApi {
	public static final String BASEURL = "http://192.168.1.102/mengmengda/mengmengda/execute/";
	/** 社区分类 */
	public static final String ACTION_COMMUNITY_CATEGORY_LIST = "community_category_list.php";
	/** 社区广告 */
	public static final String ACTION_COMMUNITY_BANNER = "community_banner.php";
	/** 社区列表 */
	public static final String ACTION_COMMUNITY_LIST = "community_list.php";
	/** 社区列表单个详情 */
	public static final String ACTION_COMMUNITY_DETAIL = "community_detail";
	/** 社区列表单个详情，楼层 */
	public static final String ACTION_COMMUNITY_DETAIL_LAYER = "community_detail_layer";

	public static final String PARAM_ACTION = "action";
	public static final String PARAM_FUP = "fup";
	public static final String PARAM_FID = "fid";
	public static final String PARAM_TID = "tid";
	public static final String PARAM_PAGE = "page";
	public static final String PARAM_PAGE_SIZE = "page_size";
	public static final String PARAM_USERNAME = "username";
	public static final String PARAM_PASSWORD = "password";

	public static final String RESPONSE_ARRAY = "array";

	/**
	 * 检查更新
	 * 
	 * @param listener
	 * @param errorListener
	 * @return
	 */
	public Request<?> checkUpdate(Listener<Boolean> listener,
			ErrorListener errorListener);

	/**
	 * 获取社区分类
	 * 
	 * @param listener
	 * @param errorListener
	 * @return
	 */
	public Request<?> getCommunityCategory(String fup,
			Listener<CommunityCategoryInfos> listener,
			ErrorListener errorListener);

	/**
	 * 获取社区列表
	 * 
	 * @param fid
	 * @param page
	 * @param pageSize
	 * @param listener
	 * @param errorListener
	 * @return
	 */
	public Request<?> getCommunityList(int fid, int page, int pageSize,
			Listener<CommunityInfos> listener, ErrorListener errorListener);

	/**
	 * 获取社区楼主详情
	 * 
	 * @param tid
	 * @param page
	 * @param pageSize
	 * @param listener
	 * @param errorListener
	 * @return
	 */
	public Request<?> getCommunityDetailInfos(String tid, int page,
			int pageSize, Listener<CommunityDetailInfos> listener,
			ErrorListener errorListener);

	/**
	 * 获取社区楼层列表
	 * 
	 * @param tid
	 * @param listener
	 * @param errorListener
	 * @return
	 */
	public Request<?> getCommunityDetailLayerInfos(String tid,
			Listener<CommunityDetailInfos> listener, ErrorListener errorListener);

	/**
	 * 登录
	 * 
	 * @param username
	 * @param password
	 * @param listener
	 * @param errorListener
	 * @return
	 */
	public Request<?> login(String username, String password,
			Listener<UserInfo> listener, ErrorListener errorListener);

}
